package com.ywu.wiki.standard.api;

import com.ywu.common.result.CommonResult;
import com.ywu.wiki.standard.dto.YwuWikiDocVersionDto;
import com.ywu.wiki.standard.service.YwuWikiDocVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName YwuWikiDocVersionApi
 * @Description TODO
 * @Author GroundDemo
 * @Date 2024/9/22 10:27
 * @Version 1.0
 **/
@RestController
@RequestMapping("/ywu/wiki/doc/version")
public class YwuWikiDocVersionApi {
    @Autowired
    private YwuWikiDocVersionService service;

    /**
    * @Author GroundDemo
    * @Description 根据resourceId查询版本列表
    * @Date 10:29 2024/9/22
    * @Param [ywuWikiDocVersionDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/version.list.info")
    public CommonResult<Object> queryVersionList(@RequestBody YwuWikiDocVersionDto ywuWikiDocVersionDto) {
        return service.queryVersionList(ywuWikiDocVersionDto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除草稿版本
    * @Date 10:45 2024/9/22
    * @Param [ywuWikiDocVersionDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/version.delete.draft.info")
    public CommonResult<Object> deleteDraftVersion(@RequestBody YwuWikiDocVersionDto ywuWikiDocVersionDto) {
        return service.deleteDraftVersion(ywuWikiDocVersionDto);
    }

    /**
    * @Author GroundDemo
    * @Description 根据版本查询历史版本信息
    * @Date 10:52 2024/9/22
    * @Param [ywuWikiDocVersionDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/version.query.info")
    public CommonResult<Object> queryVersionInfo(@RequestBody YwuWikiDocVersionDto ywuWikiDocVersionDto) {
        return service.queryVersionInfo(ywuWikiDocVersionDto);
    }

    /**
    * @Author GroundDemo
    * @Description 回退版本信息
    * @Date 10:57 2024/9/22
    * @Param [ywuWikiDocVersionDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/version.back.info")
    public CommonResult<Object> backVersionInfo(@RequestBody YwuWikiDocVersionDto ywuWikiDocVersionDto) {
        return service.backVersionInfo(ywuWikiDocVersionDto);
    }
}
